Skip to content

Fix float precision loss in jsonschema ParseFloat#4992

Open
denik wants to merge 3 commits intomainfrom
denik/random-bugfixes-3
Open

Fix float precision loss in jsonschema ParseFloat#4992
denik wants to merge 3 commits intomainfrom
denik/random-bugfixes-3

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Apr 16, 2026

Changes

  • Fix ParseFloat to use 64-bit precision instead of 32-bit, which caused silent precision loss for float values in bundle init template prompts (e.g., 1.1 became 1.100000023841858).

Tests

  • Updated unit test to use exact float comparison, verifying the precision fix.

denik added 3 commits April 16, 2026 12:21
strconv.ParseFloat(s, 32) parses the string as a float32 and then
promotes it to float64, silently losing precision. For example, "1.1"
becomes 1.100000023841858 instead of 1.1. This affects users who
specify number-type template variables during `databricks bundle init`.

Change the bit size from 32 to 64 to preserve full float64 precision.

Task: 001.md

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown

Waiting for approval

Based on git history, these people are best suited to review:

  • @lennartkats-db -- recent work in libs/jsonschema/
  • @shreyas-goenka -- recent work in libs/jsonschema/
  • @pietern -- recent work in libs/jsonschema/

Eligible reviewers: @andrewnester, @anton-107, @renaudhartert-db, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

@denik denik requested a review from pietern April 16, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant